home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1998 July
/
EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso
/
earkit
/
ftp
/
gui-ftp
/
rexx
/
ls-short.filter
< prev
next >
Wrap
Text File
|
1998-05-24
|
1KB
|
53 lines
/* REXX */
/*
** ls-short.filter
**
** Convert directory listings obtained with NLST (name list) to a usable
** format. NLST listings should have one file/directory name per line.
** if you are unable to determine whether a name is a file or a directory
** then mark it as a link.
**
** It is left to you to expand this to handle more than one name per line.
*/
do until eof( STDIN )
parse pull T$
if ~ eof( STDIN ) then do
if T$ > "" then do
SPECIAL = right( T$, 1 )
select
when SPECIAL = '/' then do
DIR = 'd'
T$ = LEFT( T$, wordlength(T$,1) - 1 )
end
when SPECIAL = '@' then do
DIR = 'l'
T$ = LEFT( T$, wordlength(T$,1) - 1 )
end
when SPECIAL = '|' then do
DIR = 'p'
T$ = LEFT( T$, wordlength(T$,1) - 1 )
end
when SPECIAL = '=' then do
DIR = 's'
T$ = LEFT( T$, wordlength(T$,1) - 1 )
end
when SPECIAL = '*' then do
DIR = '-'
T$ = LEFT( T$, wordlength(T$,1) - 1 )
end
otherwise do
DIR = '-'
end
end
OUTLINE = DIR || 'rwxrwxrwx 1 nobody nobody 0 ??? ?? ???? ' || T$
say OUTLINE
end
end
end
exit 0